<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page import="org.gruposp2p.dnie.model.DNIeDocumentToSign"%>
<%@ page import="org.gruposp2p.dnie.model.DNIeDocumentToSignOption"%>
<%@ page import="org.gruposp2p.dnie.model.DNIeDocumentType"%>
<%@ page import="java.util.Collection"%>
<%
    DNIeDocumentToSign document =
            (DNIeDocumentToSign)request.getAttribute("document");
    String jnlpPath =
            request.getContextPath() + "/jnlpFile.jsp?document=" + document.getUrl();
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <style type="text/css" media="screen">
          @import url( <c:url value="/css/style.css"/> );
        </style>
        <title><%= document.getTitle() %></title>
    </head>
<body>
    <h2><%= document.getTitle() %></h2>
    <h4><%= document.getContent() %></h4>

<%
if (document.getSignatureDataType().equals(DNIeDocumentType.VOTE)) {
    out.println("<h3>Opciones:</h3>");
    out.println("<ul>");
    Collection<DNIeDocumentToSignOption>options = document.getDNIeDocumentToSignoptionCollection();
    for (DNIeDocumentToSignOption option : options){
        out.println("<li>" + option.getContent() + "</li>");
    }
    out.println("<ul>");
}%>
<a href="<%= jnlpPath %>">Firmar documento</a>
</body>
</html>